// pages/list/list.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    title_pass: "",
    list: [
      {
        src:
          "http://b.hiphotos.baidu.com/image/pic/item/f3d3572c11dfa9ec53b720856fd0f703908fc183.jpg",
        intro: "反馈时间电话开始的刚开始三等奖各环节十多个",
        link: "www.baidu.com",
        qrUrl:
          "http://b.hiphotos.baidu.com/image/pic/item/f3d3572c11dfa9ec53b720856fd0f703908fc183.jpg",
        name: "圆通"
      },
      {
        src:
          "http://a.hiphotos.baidu.com/image/h%3D300/sign=85c0e0a9e8dde711f8d245f697eecef4/71cf3bc79f3df8dc81a2df3dc011728b461028fa.jpg",
        intro: "反馈时间电话开始的刚开始三等奖各环节十多个",
        link: "www.baidu.com",
        qrUrl:
          "https://qr.api.cli.im/qr?data=%252Fpages%252Findex%252Findex&level=H&transparent=false&bgcolor=%23ffffff&forecolor=%23000000&blockpixel=12&marginblock=1&logourl=&size=260&kid=cliim&key=249a8c7f91e192d9970a2a79ff80fa54",
        name: "顺丰"
      }
    ],
    qrUrl: "",
    intro: "",
    show: false,
    sheetTitle: "",
    rid: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      title_pass: options.title
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {},

  onClose: function(e) {
    this.setData({
      show: false
    });
    console.log("tag", e);
  },

  showQr: function(e) {
    this.setData({
      qrUrl: e.currentTarget.dataset.qrurl,
      intro: e.currentTarget.dataset.intro,
      sheetTitle: e.currentTarget.dataset.title,
      show: true
    });
  },

  scanQr: function(e) {
    wx.previewImage({
      current: e.currentTarget.dataset.qrurl,
      urls: [e.currentTarget.dataset.qrurl],
      success: result => {},
      fail: () => {},
      complete: () => {}
    });
  },

  sendQr: function(e) {
    console.log("tag", e.currentTarget.dataset.id);
  }
});
